file_name='D:\\GITEE\\study_code\\Python\\2022-11-14\\moby_dick.txt'
try:
    with open(file_name,encoding='utf-8') as f:#encoding一定要加，不然会报错！！!
        contents=(f.read()).lower()#将字符串转化为小写
except FileNotFoundError:
    print("The file do not exit !")
else:
    content=contents.split()
    print(content.count('the '))#注意这里空格的添加与否会影响最后的输出结果